from django.shortcuts import render
from blog import models

# Create your views here.


def hello(request):
    return render(request, 'index.html')

def landing(request):
    return  render(request,'landing.html')
# 下面的代码是新增加的，这个函数主要是把查询的内容渲染到 index.html页面去
def index(request):
    blog_index = models.Article.objects.all().order_by('user')

    context = {
        'blog_index': blog_index,

    }
    return render(request, 'blog.html', context)


def blog(request):
    return render(request,'blog.html')

